﻿using System;
using Seggu.Data;
using Seggu.Dtos;
using System.Linq;


namespace Seggu.Services.DtoMappers
{
    public static class VehicleTypeDtoMapper
    {
        public static VehicleTypeDto GetDto(VehicleType vt)
        {
            var dto = new VehicleTypeDto();
            dto.Id = vt.Id.ToString();
            dto.Name = vt.Name;
            return dto;
        }
        public static VehicleType GetObject(VehicleTypeDto VehicleType)
        {
            var vt = new VehicleType();
            vt.Id = new Guid();
            vt.Name = VehicleType.Name;
            vt.Bodyworks = VehicleType.Bodyworks.Select(x => BodyworkDtoMapper.GetObject(x)).ToList();
            vt.Uses = VehicleType.Uses.Select(x=> UseDtoMapper.GetObj(x)).ToList();
            return vt;
        }
    }
}
